import request from '@/utils/request'

/**
 * 更新、创建缓存
 * @param params
 * @returns AxiosPromise
 */
export function update(params) {
  return request({
    url: '/cache/update',
    method: 'post',
    params: params
  })
}

/**
 * 获取缓存
 * @param params
 * @returns AxiosPromise
 */
export function info(key) {
  return request({
    url: '/cache/by/key/' + key,
    method: 'get'
  })
}

/**
 * 更新、创建缓存
 * @param params
 * @returns AxiosPromise
 */
export function destory(id) {
  return request({
    url: '/cache/destroy/' + id,
    method: 'delete'
  })
}
